package com.mg.admin.page;

import java.io.Serializable;

/**
 * 
 * 分页参数传递工具类 .
 */
public class PageParam implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 6297178964005032338L;
	private static final int PAGE_SHOW_COUNT = 10;
	private int start; //每页开始记录
	private int currentPage; // 当前页
	private int numPerPage; // 每页记录数
	
	public PageParam(int start, int numPerPage) {
		super();
		this.start = start;
		this.numPerPage = numPerPage;
	}

	public int getStart() {
		return start;
	}

	public void setStart(int start) {
		this.start = start;
	}

	/** 每页记录数 */
	public int getNumPerPage() {
		return numPerPage > 0 ? numPerPage : PAGE_SHOW_COUNT;
	}

	/** 每页记录数 */
	public void setNumPerPage(int numPerPage) {
		this.numPerPage = numPerPage;
	}


	/**当前页**/
	public int getCurrentPage(){
		return start/numPerPage +1;
	}

}
